﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using JustinAngel.Neurons.Framework.Helpers;
using JustinAngel.UnitedNationsNews.Framework;
using JustinAngel.UnitedNationsNews.ItemViewMoels;
using Microsoft.Phone.Controls;

namespace JustinAngel.UnitedNationsNews.Pages.ArticleList
{
    public partial class ArticleListPage : BasePage
    {
        public ArticleListPage()
        {
            InitializeComponent();
        }

        private void ArticleList_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (e.AddedItems.Count > 0)
            {
                e.AddedItems[0].As<ArticleItemViewModel>().NavigateToArticle.Execute(null);

                sender.As<ListBox>().SelectedItem = null;
            }
        }
    }
}